Ch.1 Linear Systems and Gauss's Method

Return to TOC

Systems of Linear Equations

Chemistry Example

Balancing xCX7HX8+yHNOX3zCX7HX5OX6NX3+wHX2O\ce{xC7H8 + yHNO3 -> zC7H5O6N3 + wH2O}


{7x=7z8x+y=5z+2wy=3z3y=6z+w\begin{cases} 7x=7z\\8x+y=5z+2w\\y=3z\\3y=6z+w \end{cases}
From 7x=7z7x=7z, x=zx=z. From x=zx=z and y=3zy=3z, 8z+3z=5z+2ww=3z8z+3z=5z+2w\rightarrow w=3z.
Letting z=1z=1, x=1x=1, y=3y=3, w=3w=3:
CX7HX8+3HNOX3CX7HX5OX6NX3+3HX2O\ce{C7H8 + 3HNO3 -> C7H5O6N3 + 3H2O}


Gauss's Method

Linear Combination of x1,x2,...,xnx_1,x_2,...,x_n has form a1x1+a2x2++anxna_1x_1+a_2x_2+\cdots+a_nx_n, where a1,...,anRa_1,...,a_n\in\mathbb{R} are coefficients

Example 1.1

.5xy+z.5x-y+z is an example
xy+zxy+z is not

Linear Equation is in form a1x1+a2x2++anxn=da_1x_1+a_2x_2+\cdots+a_nx_n=d where dRd\in\mathbb{R} is the constant.
nn-tuple (s1,s2,...,sn)(s_1,s_2,...,s_n) satisfies the equation when a1s1+a2s2++ansn=da_1s_1+a_2s_2+\cdots+a_ns_n=d, and is called the solution
System of Linear Equation has several linear equations
a1,1x1+a1,2x2++a1,nxn=d1an,1x1+an,2x2++an,nxn=dna_{1,1}x_1+a_{1,2}x_2+\cdots+a_{1,n}x_n=d_1\\\vdots\\a_{n,1}x_1+a_{n,2}x_2+\cdots+a_{n,n}x_n=d_n
nn-tuple (s1,s2,...,sn)(s_1,s_2,...,s_n) must satisfy all equations

Row operators: arrow with expression above like ρ1+ρ2\rho_1+\rho_2 or ρ1ρ2\rho_1\leftrightarrow\rho_2
put the row in which operators act on at the end (some books put it at the start)

Leading variable: first variable with a nonzero coefficient
echelon form: the leading variable is to the right of the previous equation's leading variable
x+4y4z=011y+7z=36z=12\begin{array}{rrrrrl}x&+&4y&-&4z&=&0\\ &&-11y&+&7z&=&3\\ &&&&6z&=&12 \end{array}


Theorem:

the following operators does not change the set of solutions

  1. an equation is swapped with another (swapping)
  2. an equation has both sides multiplied by a nonzero constant (rescaling)
  3. an equation is replaced by the sum of itself and a multiple of another (row combination)
    called elementary reduction operations, row operations, or Gaussian operations

An inconsistency (like 0=10=-1) gives no solutions, an obvious fact (like 0=00=0) gives infinitely many solutions, and fewer equations than variables also gives infinitely many solutions

Example 1.2

Convert the following system of equations to echelon form:
3x4y+2z=112xy+z=3x+2y+3z=13\begin{array}{rrrrrrr} 3x&-&4y&+&2z&=&-11\\ 2x&-&y&+&z&=&-3\\ -x&+&2y&+&3z&=&13 \end{array}


3x4y+2z=112xy+z=3x+2y+3z=132ρ3+ρ13ρ3+ρ12y+11z=283y+7z=23x+2y+3z=13ρ1ρ3\begin{array}{rrrrrrr}3x&-&4y&+&2z&=&-11\\ 2x&-&y&+&z&=&-3\\ -x&+&2y&+&3z&=&13 \end{array} \xrightarrow[2\rho_3+\rho_1]{3\rho_3+\rho_1} \begin{array}{rrrrrrr} &&2y&+&11z&=&28\\ &&3y&+&7z&=&23\\ -x&+&2y&+&3z&=&13 \end{array} \xrightarrow[]{\rho_1\leftrightarrow\rho_3}
x+2y+3z=132y+11z=283y+7z=233/2ρ2+ρ3x+2y+3z=132y+11z=2819/2z=19\begin{array}{rrrrrrr} -x&+&2y&+&3z&=&13\\ &&2y&+&11z&=&28\\ &&3y&+&7z&=&23 \end{array} \xrightarrow[]{-3/2\rho_2+\rho_3} \begin{array}{rrrrrrr} -x&+&2y&+&3z&=&13\\ &&2y&+&11z&=&28\\ &&&&-19/2z&=&-19 \end{array}


Describing the Solution Set

parametrize by free variables, variables that are not leading in echelon form
2x+y+zw=5y+z+4w=6\begin{array}{rrrrrrrrr} 2x&+&y&+&z&-&w&=&5\\ &-&y&+&z&+&4w&=&6 \end{array}
Free variables are zz and ww, parametrize in terms of those and constants
y=6+z+4wx=12(5yz+w)=112z32wy=-6+z+4w\\ x=\frac{1}{2}(5-y-z+w)=\frac{11}{2}-z-\frac{3}{2}w

Example 1.3

Find the solution set to the following system of equations:
2x+y5z3w=4x+3y8z+5w=9\begin{array}{rrrrrrrr}2x&+&y&-&5z&-&3w&=&4\\-x&+&3y&-&8z&+&5w&=&-9\end{array}


2x+y5z3w=4x+3y8z+5w=9ρ1ρ22ρ2+ρ1x+3y8z+5w=97y21z+7w=141/7ρ2ρ1x3y+8z5w=9y3z+w=2\begin{array}{rrrrrrrr}2x&+&y&-&5z&-&3w&=&4\\-x&+&3y&-&8z&+&5w&=&-9\end{array}\\ \xrightarrow[\rho_1\leftrightarrow\rho_2]{2\rho_2+\rho_1}\begin{array}{rrrrrrrr}-x&+&3y&-&8z&+&5w&=&-9\\&&7y&-&21z&+&7w&=&-14\end{array}\\ \xrightarrow[1/7\rho_2]{-\rho_1}\begin{array}{rrrrrrrr}x&-&3y&+&8z&-&5w&=&9\\&&y&-&3z&+&w&=&-2\end{array}
The free variables are zz and ww, and yy can be parametrized in terms of them.
y=3zw2y=3z-w-2
Now, substitute yy and solve xx in terms of zz and ww
x3(3zw2)+8z5w=9xz2w+6=9x=z+2w+3x-3(3z-w-2)+8z-5w=9\xrightarrow{} x-z-2w+6=9\\ x=z+2w+3
So, the solutions are
x=z+2w+3y=3zw2x=z+2w+3\\y=3z-w-2


Matrices

m×nm\times n matrix has mm rows and nn columns
(a1,1a1,2a1,ja1,nai,1ai,2ai,jai,nam,1am,2am,jam,n)\begin{pmatrix}a_{1,1} & a_{1,2} & \cdots & a_{1,j} & \cdots & a_{1,n}\\\vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\a_{i,1}&a_{i,2}&\cdots&a_{i,j}&\cdots&a_{i,n}\\\vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\a_{m,1}&a_{m,2}&\cdots&a_{m,j}&\cdots&a_{m,n}\end{pmatrix}
also denoted (ai,j)i=1,...,mj=1,...,n(a_{i,j})_{\substack{i=1,...,m\\j=1,...,n}}
ai,ja_{i,j} is element in row ii and column jj

Vector

column vector, or just vector, is a matrix with a single column
single row vector called row vector
Column Vector: v=(10.50)\vec{v}=\begin{pmatrix}-1\\-0.5\\0\end{pmatrix}
Row Vector: w=(10.50)\vec{w}=\begin{pmatrix}-1 & -0.5 & 0\end{pmatrix}

Vector Sum: u+v=(u1un)+(v1vn)=(u1+v1un+vn)\vec{u}+\vec{v}=\begin{pmatrix}u_1\\\vdots\\u_n\end{pmatrix}+\begin{pmatrix}v_1\\\vdots\\v_n\end{pmatrix}=\begin{pmatrix}u_1+v_1\\\vdots\\u_n+v_n\end{pmatrix}
Scalar Multiplication: rv=r(v1vn)=(rv1rvn)r\vec{v}=r\begin{pmatrix}v_1\\\vdots\\v_n\end{pmatrix}=\begin{pmatrix}rv_1\\\vdots\\rv_n\end{pmatrix}

Turn linear system into matrix AA and column vector d\vec{d}
A=(a1,1a1,2a1,nam,1am,2am,n)and d=(d1dm)A=\begin{pmatrix}a_{1,1}&a_{1,2}&\cdots&a_{1,n}\\\vdots&\vdots&\vdots&\vdots\\a_{m,1}&a_{m,2}&\cdots&a_{m,n}\end{pmatrix} \text{and } \vec{d}=\begin{pmatrix}d_1\\\vdots\\d_m\end{pmatrix}
Converting to column matrices, the linear system can be written
x1a1+x2a2++xnan=dx_1\vec{a}_1+x_2\vec{a}_2+\cdots+x_n\vec{a}_n=\vec{d}
where
ak=(a1,kam,k)\vec{a}_k=\begin{pmatrix}a_{1,k}\\\vdots\\a_{m,k}\end{pmatrix}

Augmented Matrix

combines matrix AA and column vector d\vec{d} into one matrix
(Ad)=(a1,1a1,2a1,ja1,nd1ai,1ai,2ai,jai,ndiam,1am,2am,jam,ndm)(A|\vec{d})=\left(\begin{array}{cccccc|c}a_{1,1} & a_{1,2} & \cdots & a_{1,j} & \cdots & a_{1,n}&d_{1}\\\vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\a_{i,1}&a_{i,2}&\cdots&a_{i,j}&\cdots&a_{i,n}&d_i\\\vdots&\vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\a_{m,1}&a_{m,2}&\cdots&a_{m,j}&\cdots&a_{m,n}&d_m\end{array}\right)

Use row reduction on an augmented matrix to simplify the process of solving linear systems

Parametrized solutions can be written in vector notation
e.g.
{(xyz)=(1/310)+z(2/34/31)|zR}\left\{\begin{pmatrix}x\\y\\z\end{pmatrix}=\begin{pmatrix}1/3\\1\\0\end{pmatrix}+z\begin{pmatrix}2/3\\4/3\\1\end{pmatrix}\middle|z\in\mathbb{R}\right\}

Example 1.4

The following linear system
2x1+3x24x3+x4=12x12x2+4x32x4=93x1+x23x4=3x23x4=62x_1+3x_2-4x_3+x_4=-12\\-x_1-2x_2+4x_3-2x_4=9\\-3x_1+x_2-3x_4=-3\\x_2-3x_4=-6
can be turned into the matrix and column vector
A=(2341124231030103)d=(12936)\begin{array}{cc}A=\begin{pmatrix}2&3&-4&1\\-1&-2&4&-2\\-3&1&0&-3\\0&1&0&-3\end{pmatrix}\vec{d}=\begin{pmatrix}-12\\9\\-3\\-6\end{pmatrix}\end{array}
The matrix AA can be split into column matrices, so the linear system can also be written
x1(2130)+x2(3211)+x3(4400)+x4(1233)=(12936)x_1\begin{pmatrix}2\\-1\\-3\\0\end{pmatrix}+x_2\begin{pmatrix}3\\-2\\1\\1\end{pmatrix}+x_3\begin{pmatrix}-4\\4\\0\\0\end{pmatrix}+x_4\begin{pmatrix}1\\-2\\-3\\-3\end{pmatrix}=\begin{pmatrix}-12\\9\\-3\\-6\end{pmatrix}

In augmented matrix form, this looks like
(234112124293103301036)\left(\begin{array}{cccc|c}2&3&-4&1&-12\\-1&-2&4&-2&9\\-3&1&0&-3&-3\\0&1&0&-3&-6\end{array}\right)
The system can be solved by applying row reduction to the augmented matrix
(234112124293103301036)ρ4+ρ3(234112124293000301036)ρ11/3ρ3(100011242923411201036)2ρ1+ρ3ρ1+ρ2(100010242803411001036)ρ4ρ2(100010103603411002428)2ρ2+ρ43ρ2+ρ3(100010103600410800484)ρ3+ρ4(100010103600410800024)Echelon Form\begin{array}{rccc} &\left(\begin{array}{cccc|c}2&3&-4&1&-12\\-1&-2&4&-2&9\\-3&1&0&-3&-3\\0&1&0&-3&-6\end{array}\right)&\xrightarrow{-\rho_4+\rho_3}&\left(\begin{array}{cccc|c}2&3&-4&1&-12\\-1&-2&4&-2&9\\-3&0&0&0&3\\0&1&0&-3&-6\end{array}\right)\\ \\ \xrightarrow{\rho_1\leftrightarrow1/-3\rho_3}&\left(\begin{array}{cccc|c}1&0&0&0&-1\\-1&-2&4&-2&9\\2&3&-4&1&-12\\0&1&0&-3&-6\end{array}\right)&\xrightarrow[-2\rho_1+\rho_3]{\rho_1+\rho_2}&\left(\begin{array}{cccc|c}1&0&0&0&-1\\0&-2&4&-2&8\\0&3&-4&1&-10\\0&1&0&-3&-6\end{array}\right)\\ \\ \xrightarrow{\rho_4\leftrightarrow\rho_2}&\left(\begin{array}{cccc|c}1&0&0&0&-1\\0&1&0&-3&-6\\0&3&-4&1&-10\\0&-2&4&-2&8\end{array}\right)&\xrightarrow[2\rho_2+\rho_4]{-3\rho_2+\rho_3}&\left(\begin{array}{cccc|c}1&0&0&0&-1\\0&1&0&-3&-6\\0&0&-4&10&8\\0&0&4&-8&-4\end{array}\right)\\ \\ \xrightarrow{\rho_3+\rho_4}&\begin{array}{c}\left(\begin{array}{cccc|c}1&0&0&0&-1\\0&1&0&-3&-6\\0&0&-4&10&8\\0&0&0&2&4\end{array}\right)\\\text{Echelon Form}\end{array}&& \end{array}
This is equivalent to the linear system
x1=1x23x4=64x3+10x4=82x4=4\begin{array}{rrrrrrrrr}x_1&&&&&&&=&-1\\&&x_2&&&&-3x_4&=&-6\\&&&&-4x_3&+&10x_4&=&8\\&&&&&&2x_4&=&4\end{array}
From row 4,
x4=2x_4=2
From row 3,
4x3+10(2)=8x3=3-4x_3+10(2)=8\rightarrow x_3=3
From row 2,
x23(2)=6x2=0x_2-3(2)=-6\rightarrow x_2=0
From row 1,
x1=1x_1=-1
So, the solution is
(x1x2x3x4)=(1032)\begin{pmatrix}x_1\\x_2\\x_3\\x_4\end{pmatrix}=\begin{pmatrix}-1\\0\\3\\2\end{pmatrix}